<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" 
	>
	
	

<ui:composition template="/PANEL/layouts/MasterPage.xhtml">
	
	
	
	<ui:define name="content">
	<h:form id="form">
	
	
	<p:menubar styleClass="MenuBar">
        <p:menuitem styleClass="MenuItem" update="form" action="#{eventBean.getAllEvents}"  value="Tüm Etkinlikler" icon="ui-icon-document"></p:menuitem>

        <p:menuitem styleClass="MenuItem"  update="form"  action="#{eventBean.getParticipatedEventsbyUser}" value="Katıldığım Etkinlikler" icon="ui-icon-pencil"></p:menuitem>

        <p:menuitem styleClass="MenuItem" update="form" action="#{eventBean.getPastEvent}" value="Geçmiş Etkinlikler"  icon="ui-icon-help"></p:menuitem>

        <p:menuitem styleClass="MenuItem" update="form"  action="#{eventBean.getComingEvent}"  value="Gelecek Etkinlikler" icon="ui-icon-gear"> </p:menuitem>  
    </p:menubar>
    
    <p:dataTable emptyMessage="Kayıt Bulunamadı" id="eventTable" style="font-size:13px"    value="#{eventBean.eventList}"  var="event"
	    paginator="true" rows="10" paginatorPosition="bottom" 
        paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
        rowsPerPageTemplate="5,10,15">  
	    
	     <f:facet name="header" >
	     #{eventBean.tableHeader}
	     </f:facet>
	     <p:column>
	     <f:facet name="header">
	     <h:outputText value="Etkinlik Adı"></h:outputText>
	     </f:facet>
	     
	     <h:outputText value="#{event.eventname}"></h:outputText>
	     </p:column>
	     
	     <p:column>
	     <f:facet name="header">
	     <h:outputText value="Etkinlik Tipi"></h:outputText>
	     </f:facet>
	     
	   <ui:repeat value="#{event.eventtypeofevents}" var="eventypeofevents">
	   #{eventypeofevents.eventtype.eventtypename}
	  	   <br/>
	   </ui:repeat>
	     </p:column>
	     
	     <p:column>
	     <f:facet name="header">
	     <h:outputText value="Etkinlik Sahibi"></h:outputText>
	     </f:facet>
	     
	     
	     <h:outputText value="#{event.instıtutıon.institutionname}"></h:outputText>
	     </p:column>
	     
	       <p:column>
	     <f:facet name="header">
	     <h:outputText value="Başlangıç Tarihi">
	     </h:outputText>
	     </f:facet>
	     
	     
	     <h:outputText value="#{event.begindate}">
	     <f:convertDateTime type="date" dateStyle="long"></f:convertDateTime>
	     </h:outputText>
	     </p:column>
	     
	     
	       <p:column>
	     <f:facet name="header">
	     <h:outputText value="Bitiş Tarihi">
	     </h:outputText>
	     </f:facet>
	    
	     <h:outputText value="#{event.finishdate}">
	      <f:convertDateTime type="date" dateStyle="long"></f:convertDateTime>
	    </h:outputText>
	    
	    
	     </p:column>
	     
	     
	     <p:column>
	     <f:facet name="header">
	     <h:outputText value="Adres"></h:outputText>
	     </f:facet>
	     
	     <ui:repeat var="lookup" value="#{event.adresslookups}">
	     
	     <h:outputText value="#{lookup.adress.streetname}"></h:outputText>
	     </ui:repeat>
	     </p:column>
	     
	    </p:dataTable>
	    </h:form>
	</ui:define>
	
</ui:composition>

</html>